package com.gnkexy.springframework.beans;

import java.util.ArrayList;
import java.util.List;

public class PropertyValues {

    private final List<PropertyValue> propertyValueList = new ArrayList<>();

    public void addProperty(PropertyValue propertyValue){
        propertyValueList.add(propertyValue);
    }

    public PropertyValue[] getProperS(){
        return propertyValueList.toArray(new PropertyValue[0]);
    }

    public PropertyValue getProperty(String properName){
        for (PropertyValue pv : propertyValueList) {
            if(pv.getName().equals(properName)){
                return pv;
            }
        }
        return null;
    }


    public void addPropertyValue(PropertyValue company) {
        propertyValueList.add(company);
    }
}
